home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #14
/
Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO
/
prog_bas
/
vbwarn.zip
/
FRMNEWP.FRM
< prev
next >
Wrap
Text File
|
1995-12-11
|
14KB
|
474 lines
VERSION 2.00
Begin Form frmNewP
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Double
Caption = "Add New Person"
ClientHeight = 2145
ClientLeft = 345
ClientTop = 3015
ClientWidth = 8955
ControlBox = 0 'False
Height = 2550
Left = 285
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2145
ScaleWidth = 8955
Top = 2670
Width = 9075
Begin CommandButton cmdCancel
Caption = "&Cancel Add and Return To Ticket"
Height = 375
Left = 4920
TabIndex = 18
Top = 1620
Width = 3135
End
Begin CommandButton cmdSave
Caption = "&Save Person and Add To Ticket"
Height = 375
Left = 840
TabIndex = 17
Top = 1620
Width = 2955
End
Begin Data dtaPerson
BackColor = &H00C0C0C0&
Caption = "Person"
Connect = ""
DatabaseName = "VBWARN.MDB"
Exclusive = 0 'False
Height = 315
Left = 1920
Options = 0
ReadOnly = 0 'False
RecordSource = "Person"
Top = 120
Visible = 0 'False
Width = 1215
End
Begin TextBox txtFNameP
BackColor = &H00C0C0C0&
DataField = "FName"
DataSource = "dtaPerson"
Height = 315
Left = 5760
TabIndex = 1
Top = 240
Width = 1035
End
Begin TextBox txtLNameP
BackColor = &H00C0C0C0&
DataField = "LName"
DataSource = "dtaPerson"
Height = 315
Left = 3720
TabIndex = 0
Top = 240
Width = 1455
End
Begin TextBox txtInitialP
BackColor = &H00C0C0C0&
DataField = "Initial"
DataSource = "dtaPerson"
Height = 315
Left = 7200
TabIndex = 2
Top = 240
Width = 615
End
Begin TextBox txtCityP
BackColor = &H00C0C0C0&
DataField = "City"
DataSource = "dtaPerson"
Height = 315
Left = 3720
TabIndex = 4
Top = 540
Width = 1455
End
Begin TextBox txtDLStP
BackColor = &H00C0C0C0&
DataField = "DLSt"
DataSource = "dtaPerson"
Height = 315
Left = 3720
TabIndex = 8
Top = 840
Width = 495
End
Begin TextBox txtWeightP
BackColor = &H00C0C0C0&
DataField = "Weight"
DataSource = "dtaPerson"
Height = 315
Left = 3720
TabIndex = 14
Top = 1140
Width = 615
End
Begin TextBox txtStateP
BackColor = &H00C0C0C0&
DataField = "State"
DataSource = "dtaPerson"
Height = 315
Left = 5760
TabIndex = 5
Top = 540
Width = 495
End
Begin TextBox txtDLTypeP
BackColor = &H00C0C0C0&
DataField = "DLType"
DataSource = "dtaPerson"
Height = 315
Left = 5760
TabIndex = 9
Top = 840
Width = 795
End
Begin TextBox txtHairP
BackColor = &H00C0C0C0&
DataField = "Hair"
DataSource = "dtaPerson"
Height = 315
Left = 5760
TabIndex = 15
Top = 1140
Width = 795
End
Begin TextBox txtAddressP
BackColor = &H00C0C0C0&
DataField = "Address"
DataSource = "dtaPerson"
Height = 315
Left = 960
TabIndex = 3
Top = 540
Width = 2235
End
Begin TextBox txtDLP
BackColor = &H00C0C0C0&
DataField = "DL"
DataSource = "dtaPerson"
Height = 315
Left = 960
TabIndex = 7
Top = 840
Width = 1815
End
Begin TextBox txtFeetP
BackColor = &H00C0C0C0&
DataField = "Feet"
DataSource = "dtaPerson"
Height = 315
Left = 960
TabIndex = 12
Top = 1140
Width = 315
End
Begin TextBox txtInchesP
BackColor = &H00C0C0C0&
DataField = "Inches"
DataSource = "dtaPerson"
Height = 315
Left = 1560
TabIndex = 13
Top = 1140
Width = 315
End
Begin TextBox txtZipP
BackColor = &H00C0C0C0&
DataField = "Zip"
DataSource = "dtaPerson"
Height = 315
Left = 7200
TabIndex = 6
Top = 540
Width = 1095
End
Begin TextBox txtEyesP
BackColor = &H00C0C0C0&
DataField = "Eyes"
DataSource = "dtaPerson"
Height = 315
Left = 7200
TabIndex = 16
Top = 1140
Width = 735
End
Begin TextBox txtDOBP
BackColor = &H00C0C0C0&
DataField = "DOB"
DataSource = "dtaPerson"
Height = 315
Left = 7200
TabIndex = 10
Text = " "
Top = 840
Width = 915
End
Begin TextBox txtSexP
BackColor = &H00C0C0C0&
DataField = "Sex"
DataSource = "dtaPerson"
Height = 285
Left = 8580
TabIndex = 11
Top = 840
Width = 255
End
Begin Label lblID
BackColor = &H00E0FFFF&
BorderStyle = 1 'Fixed Single
DataField = "ID"
DataSource = "dtaPerson"
Height = 315
Left = 960
TabIndex = 38
Top = 240
Width = 735
End
Begin Label Label5
BackColor = &H00C0C0C0&
Caption = "Last:"
Height = 255
Left = 3240
TabIndex = 36
Top = 240
Width = 495
End
Begin Label Label3
BackColor = &H00C0C0C0&
Caption = "ID:"
Height = 255
Left = 660
TabIndex = 37
Top = 240
Width = 315
End
Begin Label Label14
BackColor = &H00C0C0C0&
Caption = "First:"
Height = 255
Left = 5280
TabIndex = 35
Top = 240
Width = 495
End
Begin Label Label15
BackColor = &H00C0C0C0&
Caption = "Init:"
Height = 255
Left = 6840
TabIndex = 34
Top = 240
Width = 375
End
Begin Label Label16
BackColor = &H00C0C0C0&
Caption = "Address:"
Height = 255
Left = 180
TabIndex = 33
Top = 540
Width = 795
End
Begin Label Label17
BackColor = &H00C0C0C0&
Caption = "City:"
Height = 255
Left = 3300
TabIndex = 32
Top = 540
Width = 495
End
Begin Label Label18
BackColor = &H00C0C0C0&
Caption = "State:"
Height = 255
Left = 5220
TabIndex = 31
Top = 540
Width = 555
End
Begin Label Label19
BackColor = &H00C0C0C0&
Caption = "Zip:"
Height = 255
Left = 6840
TabIndex = 30
Top = 540
Width = 435
End
Begin Label Label20
BackColor = &H00C0C0C0&
Caption = "DL#:"
Height = 255
Left = 480
TabIndex = 29
Top = 840
Width = 495
End
Begin Label Label21
BackColor = &H00C0C0C0&
Caption = "State:"
Height = 255
Left = 3180
TabIndex = 28
Top = 840
Width = 555
End
Begin Label Label22
BackColor = &H00C0C0C0&
Caption = "Type:"
Height = 255
Left = 5220
TabIndex = 27
Top = 840
Width = 555
End
Begin Label Label23
BackColor = &H00C0C0C0&
Caption = "DOB:"
Height = 255
Left = 6720
TabIndex = 26
Top = 840
Width = 495
End
Begin Label Label24
BackColor = &H00C0C0C0&
Caption = "Sex:"
Height = 255
Left = 8160
TabIndex = 25
Top = 840
Width = 435
End
Begin Label Label25
BackColor = &H00C0C0C0&
Caption = "Height:"
Height = 255
Left = 300
TabIndex = 24
Top = 1140
Width = 615
End
Begin Label Label26
BackColor = &H00C0C0C0&
Caption = "'"
Height = 255
Left = 1440
TabIndex = 23
Top = 1140
Width = 135
End
Begin Label Label27
BackColor = &H00C0C0C0&
Caption = "''"
Height = 315
Left = 1920
TabIndex = 22
Top = 1140
Width = 195
End
Begin Label Label28
BackColor = &H00C0C0C0&
Caption = "Weight:"
Height = 255
Left = 3060
TabIndex = 21
Top = 1140
Width = 735
End
Begin Label Label29
BackColor = &H00C0C0C0&
Caption = "Hair:"
Height = 255
Left = 5280
TabIndex = 20
Top = 1140
Width = 495
End
Begin Label Label30
BackColor = &H00C0C0C0&
Caption = "Eyes:"
Height = 255
Left = 6660
TabIndex = 19
Top = 1140
Width = 555
End
End
Option Explicit
Sub cmdCancel_Click ()
GlobalPersonID = 0
Unload frmNewP
End Sub
Sub cmdSave_Click ()
On Error GoTo CheckLenErr
Dim Namex As String
If txtLNameP <> "" And txtFNameP <> "" Then
dtaPerson.Recordset.Update
dtaPerson.Recordset.MoveLast
GlobalPersonID = dtaPerson.Recordset!ID
Namex = txtLNameP
Namex = Namex & ", " & Trim$(txtFNameP)
If Not IsNull(dtaPerson.Recordset("Initial")) Then
Namex = Namex & ", " & Trim$(dtaPerson.Recordset("Initial"))
End If
Namex = Namex & " - " & dtaPerson.Recordset("ID")
VBWarn!cmbPerson.AddItem Namex
Unload frmNewP
Else
MsgBox "Must have a first and last name" , MB_EXCL , "Warning Ticket"
txtLNameP.SetFocus
End If
Exit Sub
CheckLenErr:
If Err = 3163 Then
MsgBox "A value is too long, fix or cancel save" , MB_EXCL , "Warning Ticket"
Exit Sub
Else
MsgBox "Unexpected Error " & "'" & Err & "'" , MB_EXCL , "Warning Ticket"
Exit Sub
End If
Resume
End Sub
Sub Form_Activate ()
dtaPerson.Recordset.AddNew
txtLNameP.SetFocus
End Sub
Sub txtDLStP_KeyPress (KeyAscii As Integer)
If (KeyAscii >= Asc("a")) And (KeyAscii <= Asc("z")) Then KeyAscii = KeyAscii - 32
End Sub
Sub txtDLTypeP_KeyPress (KeyAscii As Integer)
If (KeyAscii >= Asc("a")) And (KeyAscii <= Asc("z")) Then KeyAscii = KeyAscii - 32
End Sub
Sub txtDOBP_LostFocus ()
If (Not IsDate(txtDOBP.Text)) And (txtDOBP <> "") Then
MsgBox ("Enter a valid date of birth") , MB_EXCL , "Warning Ticket"
txtDOBP.SetFocus
End If
End Sub
Sub txtSexP_KeyPress (KeyAscii As Integer)
If (KeyAscii >= Asc("a")) And (KeyAscii <= Asc("z")) Then KeyAscii = KeyAscii - 32
End Sub
Sub txtStateP_KeyPress (KeyAscii As Integer)
If (KeyAscii >= Asc("a")) And (KeyAscii <= Asc("z")) Then KeyAscii = KeyAscii - 32
End Sub